package com.project_doctor.service;

import com.project_doctor.pojo.Message;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
* @author 龙龙与贝儿
* @description 针对表【t_message】的数据库操作Service
* @createDate 2025-06-07 11:22:51
*/
public interface MessageService extends IService<Message> {
    /**
     * 保存消息
     */
    Message saveMessage(Message message);

    /**
     * 根据会话ID获取消息列表
     */
    List<Message> getMessagesByConversationId(Long conversationId);

    void markAsReadBatch(Long conversationId,Long userId);

    // 从 Redis 中获取最新一条消息
    Message getLatestMessage(Long conversationId);

    Integer calculateUnreadCount(Long conversationId, Long userId);

    //
//    Message getMessageById(Long id);
//
//    void markMessageAsRead(Long messageId);
}
